/*--------------------------------------------------------------------------------------------------
Yatak Operation System Project Copyright 2012-2013
Author : Ilya Churaev
Started : 4 Mar 2013		Updated : 4 Mar 2013
File Name : devices.h		Purpose : devices list, Includes all major and minor numbers for the devices.
--------------------------------------------------------------------------------------------------*/
#ifndef _YATAK_DEVICES_H
#define _YATAK_DEVICES_H

#ifdef __cplusplus
extern "C" {
#endif

#include <pci.h>
#include <sys/types.h>

#define MAX_DEVICES                     40

#define ROOT_DEV DEVICE_RAMDISK_MAJOR

#define DEVICE_FLOPPY_MAJOR              1
#define DEVICE_FLOPPY_NAME               "fd1"

// DISKS reaches from 10 up to 20
#define DEVICE_DISK_MAJOR                10

#define DEVICE_KEYBOARD_MAJOR            30
#define DEVICE_KEYBOARD_NAME             "keyboard"

struct s_devices
{
  int major;
  unsigned char name[20];
  int pid;
};

struct file_operations
{
       int (*lseek) (void);
       int (*read) (int, unsigned char*);
       int (*write) (int, unsigned char*);
       int (*readdir) (void);
       int (*select) (void);
       int (*ioctl) (void);
       int (*mmap) (void);
       int (*open) (void);
       void (*release) (void);
       int (*fsync) (void);
};

struct list_devices
{
	PCI_Device_t device;
	bool init_drive;
	struct list_devices * next;
};

typedef struct list_devices list_devices_t;

list_devices_t * AddDevice (list_devices_t * head, PCI_Device_t * device, bool init_drive);

/************************ Mouse PS/2 *************************************/
void init_ps2_mouse();
int detect_ps2_mouse();

#ifdef __cplusplus
}
#endif

#endif
